# logging: 记录日志信息
import logging
import time

filename = "./logs/" + time.strftime("%Y-%m-%d.log", time.localtime())
logging.basicConfig(
    level=logging.DEBUG,
    filename=filename,
    filemode="a",
    format="%(asctime)s - %(levelname)s - %(message)s",
)

logging.debug("debug")
logging.info("info")
logging.warning("warning")
logging.error("error")
logging.critical("critical")

# 默认的level是 warning, 只有大于等于warning的才会显示
# 可以通过设置level, 来调整显示的日志信息的级别
logging.debug("debug")
logging.info("info")
logging.warning("warning")
logging.error("error")
logging.critical("critical")
